package com.yl.auth.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yl.auth.entity.Role;
import com.yl.auth.mapper.RoleMapper;
import com.yl.auth.service.RoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ln
 * @since 2023-07-18
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
    @Resource
    private RoleMapper roleMapper;
    @Override
    public List<Integer> getByIdRole(Integer id) {
        return roleMapper.getByIdRole(id);
    }



    @Override
    public IPage<Role> findRole(Page<Role> page1) {
        return roleMapper.findRole(page1);
    }

    @Override
    public Role getByrole(Integer id) {
        return roleMapper.getByrole(id);
    }

    @Override
    public void saverole(Integer id, Integer rid) {
        roleMapper.saverole(id,rid);
    }

    @Override
    public void removeRole(Integer id) {
        roleMapper.remove(id);
    }

    @Override
    public List<Integer> getByIdrole(Integer id) {
        return roleMapper.getByIdRole(id);
    }

    @Override
    public List<Integer> getrole(Integer id) {
        return roleMapper.getrole(id);
    }

    @Override
    public IPage<Role> getAll(Page<Role> page1) {
        return roleMapper.getAll(page1);
    }


    @Override
    public void removeBiao(Integer id) {
        roleMapper.deleteRolePermission(id);
    }

    @Override
    public List<Role> getAllByType() {
        return roleMapper.getAllByType();
    }

    @Override
    public Role getUserId(Integer usersId) {
        return roleMapper.getUserId(usersId);
    }

    @Override
    public void updaterole(Integer id) {
        roleMapper.updaterole(id);
    }

    @Override
    public List<Role> listrole() {
        return roleMapper.listrole();
    }

    @Override
    public List<Role> quanxianList(Long id) {
        return roleMapper.quanxianList(id);
    }

    @Override
    public void removeByDelId(Integer id) {
        roleMapper.removeByDelId(id);
    }


}
